Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Route with literal path segment makes route with variable path segment unavailable #3040

Merged
merged 12 commits into from
Aug 27, 2024

Conversation

narma
Copy link
Contributor

@narma narma commented Aug 19, 2024

Resolves #3036

So case happens when literal and other (codec) in subtree are both valid for path segment we try only literal one but tail is valid only for not-literal one
To fix this, I've added backtracking to other codec way in unhappy case when literal one was give us empty results. Also we don't do backtracking if others segments doesn't match literals.

This solution is optimized for cases without these conflicts, but when this case happened - backtracking is always slow, perhaps futher we need to investigate different approach to solve this issue.

narma added 2 commits August 19, 2024 22:44
When we have race with literals and others and tail not matches for literals
we need to check others path too.
@narma
Copy link
Contributor Author

narma commented Aug 26, 2024

Implementation of #2960 will rewrite all of these code, but I think we should merge this to get new tests for this issue.

@987Nabil
Copy link
Contributor

I saw the PR, but did not find the time to take a good look

@narma
Copy link
Contributor Author

narma commented Aug 26, 2024

@987Nabil No worries! Take your time

@jdegoes jdegoes merged commit dcf80a1 into zio:main Aug 27, 2024
34 checks passed
@narma narma deleted the fix-i3036 branch August 27, 2024 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Route with literal path segment makes route with variable path segment unavailable
3 participants